<!--
 - 隐私查看器 For 校内网
 - Write by icyleaf.
 - Time: 10/10/2008
 - URI: http://icyleaf.com
 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!--<meta http-equiv="refresh" content="2">-->
<title>校内网，开心网，海内网用户隐私查看器 -- Made by icyleaf</title>
<style type="text/css">
body{
    background: #BABABA url();
    font-size:0.9em;
    color:#595959;
    text-align:center;
}

a{color: #679C2F;}
a:hover{color:#994C4A}

img{border:none;}

#warp{
    margin:0 auto;
    padding:0;
    width:620px;
    text-align:left;
}
#box{
    background:#E1E1E1;
    border:1px solid #A3A2A2;
}

#box h1{
    background:#929292;
    font-size:1.8em;
    color:#F5F5F5;
    margin:0;
    text-align:center;
}

div.list{padding:10px}

.block{
	margin:0;
	padding:5px 10px;
	border-top:1px solid #A3A2A2;
}
.block h2{
	font-size:14px;
	color: #994C4A;
	border-left:3px solid #994C4A;
	padding-left:6px;
}


#user_id, #result{width:200px}
.red{color: red}
.bold{font-weight: bold}
.right{float:right}
.clear{clear:both}
</style>

</head>
<body>
<div id="warp">
    <div id="box">
        <h1>校内网，开心网，海内网用户隐私查看器</h1>
        <div class="list">
            <form action="<?php echo $_SERVICE['POST'] ?>" method="post">
                用户ID：
                <input id="user_id" type="text" name="user_id" value="<?php echo $_POST['user_id']?$_POST['user_id']:''; ?>"/>
                <select name="website" id="website">
                	<?php
                		$select = array
                		(
                			'校内网' => 'xiaonei',
                			'海内网' => 'hainei',
                			'开心网' => 'kaixin'
                		);
                		$website = $_POST["website"]?$_POST["website"]:'xiaonei';
                		foreach($select as $key => $value){
                			if( $value === $website){
                				echo '<option value="'.$value.'" selected>'.$key.'</option>';
                				$website_name = $key;
		                	}else{
		                		echo '<option value="'.$value.'">'.$key.'</option>';
		                	}
                		}
                	?>
				</select>
                <input type="submit" name="submit" value="Get it!" />
            </form>
        </div>
        <?php
		if( isset($_POST['user_id']) && $_POST['user_id']!='' )
		{
			$uid = $_POST['user_id'];
			$website = $_POST["website"];
			switch($website)
			{
				case 'hainei':
					$photo_address = 'http://www.hainei.com/photos?r='.$uid;
					$blog_address = 'http://www.hainei.com/miniblogs?r='.$uid;
					$dong_address = 'http://www.hainei.com/blogs?r='.$uid;
					$user_profile = 'http://www.hainei.com/user?r='.$uid;
					$user_name = $uid;
					break;

				case 'kaixin':
					$photo_address = 'http://www.kaixin001.com/photo/?uid='.$uid;
					$blog_address = 'http://www.kaixin001.com/diary/?uid='.$uid;
					$dong_address = 'http://www.kaixin001.com/app/app.php?aid=1018&uid='.$uid;
					$user_profile = 'http://www.kaixin001.com/home/?uid='.$uid;
					$user_name = $uid;
					break;

				default;case 'xiaonei':
					$photo_address = 'http://photo.xiaonei.com/getalbumlist.do?id='.$uid;
					$blog_address = 'http://blog.xiaonei.com/GetBlog.do?id='.$uid;
					$dong_address = 'http://xiaonei.com/getdoing.do?id='.$uid;
					$user_profile = 'http://xiaonei.com/profile.do?id='.$uid;
					$user_content = get_content ($user_profile);

					preg_match('/src=(.*)jpg/', $user_content, $match_picture);
					$user_picture = substr($match_picture[1],1);
					if(empty($user_picture))
						$user_picture = 'http://xnimg.cn/img/d_default.gif';
					else
						$user_picture = substr($match_picture[1],1).'jpg';

					preg_match('/<title>(.*)<\/title>/', $user_content, $match_title);
					preg_match('/校内网 - (.*) \(/', $match_title[1], $match_name);
					$user_name = $match_name[1];

					preg_match('/(\d+)张/', $user_content, $match_photo_count);
					$photo_count = "($match_photo_count[1])";

					preg_match('/(\d+)篇/', $user_content, $match_blog_count);
					$blog_count = "($match_blog_count[1])";
					break;
			}
			$output = '<div class="block">';
			$output .= '<h2>'.$website_name.'用户['.$user_name.']的信息</h2>';
			if( isset($user_picture) )
				$output .= '<a href="'.$user_profile.'" title="'.$user_name.'的个人主页"><img src="'.$user_picture.'" /></a><br /><br />';
			$output .= '<a href="'.$photo_address.'" target="_blank">'.$user_name.'的相册</a>'.$photo_count.' | ';
			$output .= '<a href="'.$blog_address.'" target="_blank">'.$user_name.'的日记</a>'.$blog_count.' | ';
			$output .= '<a href="'.$dong_address.'" target="_blank">'.$user_name.'的状态记录(迷你博客）</a>';
			$output .= '</div>';
			echo $output;
		}

        function get_content($url){
            $ch = curl_init();

            curl_setopt ($ch, CURLOPT_URL, $url);
            curl_setopt ($ch, CURLOPT_HEADER, 0);
            curl_setopt($ch, CURLOPT_REFERER, "");
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

            ob_start();

            curl_exec ($ch);
            curl_close ($ch);
            $string = ob_get_contents();

            ob_end_clean();

            return $string;
        }
		?>

        <div class="block">
        	<h2>使用介绍</h2>
        	<p class="red bold">
        		无论你查询那个网站的用户资料，首先！必须先登录网站系统之后才进行操作！
        	</p>
        	<p>
        		<a href="http://xiaonei.com" target="_blank">校内网</a>是中国大学生的社会化交友网站。现阶段向高中生，大学生和公司用户开放，
        		为保证用户隐私，你需要成为正式用户。最重要的是，用户可以设置是否让陌生人可见自己的用户资料等信息。但由于校内网自身机制问题，
        		可以通过地址绕过的方式查看用户的相册，日志，状态记录等等非用户资料信息。点击下面的详情查看原理和补救方法。
				<br /><span class="bold">可获得有用资源率</span>：<span class="red">98%</span>
        	</p>
        	<p>
        		<a href="http://hainei.com" target="_blank">海内网</a>同样是王兴的团队另起炉灶打造的新的社会化交友真人网络。
        		但由于海内网自身机制问题，可以通过地址绕过的方式查看用户的相册，日志，状态记录等等非用户资料信息。点击下面的详情查看原理和补救方法。
        		<br /><span class="bold">可获得有用资源率</span>：<span class="red">98%</span>
        	</p>
        	<p>
        		<a href="http://kaixin001.com" target="_blank">开心网</a>是中国上班一族最火的社会化交友网站。
        		但由于开心网自身机制比较完善，虽然可以通过地址绕过的方式查看用户的相册，日志，状态记录等等非用户资料信息。但是隐私机制做的很好，
        		很难有机率可以得到用户的相册，日志，状态记录等等非用户资料信息。点击下面的详情查看例外情况，原理和补救方法。
        		<br /><span class="bold">可获得有用资源率</span>：<span class="red">30%</span>
        	</p>
        </div>

        <div class="block">
            <h2>特别声明</h2>
            <p>本工具只为技术交流使用，请勿做非法事情，如有此事请自己承担法律责任！切记！切记！</p>
        </div>

        <div class="block">
            <div class="right">
	            Made by <a href="http://icyleaf.com/">icyleaf</a>
	        </div>
            > 详情请看：<a href="http://icyleaf.com/2008/10/10/the-school-network-network-happy-at-home-and-network-user-privacy-viewer/" target="_blank">用户隐私查看器使用说明</a>
        </div>
    </div>
</div>
</body>
</html>
